﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using DR.WebUI.Models.Common;
using DR.WebUI.Models.Enums;

namespace DR.WebUI.Code
{
    public static class MiscHelpers
    {
        public static int GetPageCount(int pageSize, int count)
        {
            var pages = count / pageSize;
            if (count % pageSize > 0) pages++;

            return pages;
        }

        public static IList<EnumItem> GetAllFilterReportStatuses()
        {
            IList<EnumItem> filterReportStatuses = new List<EnumItem>();
            filterReportStatuses.Add(new EnumItem { StatusID = (int)ReportStatus.Pending, Text = "Pending" });
            filterReportStatuses.Add(new EnumItem { StatusID = (int)ReportStatus.Approved, Text = "Approved" });
            filterReportStatuses.Add(new EnumItem { StatusID = (int)ReportStatus.Rejected, Text = "Rejected" });
            return filterReportStatuses;
        }

        public static IList<EnumItem> GetAllProjectStatuses()
        {
            IList<EnumItem> projectStatuses = new List<EnumItem>();
            projectStatuses.Add(new EnumItem { StatusID = (int)ProjectStatus.Open, Text = "Open" });
            projectStatuses.Add(new EnumItem { StatusID = (int)ProjectStatus.Frozen, Text = "Frozen" });
            projectStatuses.Add(new EnumItem { StatusID = (int)ProjectStatus.Closed, Text = "Closed" });
            return projectStatuses;
        }
    }
}